home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 9.6 KB | 270 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Hypercard.vu
- #
- # Contains: Quick look test script for Hypercard version 2.1
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/10/93 KTA Added a couple of waits after selecting 'Save As' to allow
- # dialog to appear - failing on slower machines.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","StandardFile.Lib","Print.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up the tool palettes for Hypercard. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kPaintPaletteNum := 1;
-
- global gPaletteList := {
- { #### Start Palette #1 - Paint
- {159,11,137,20}, # Location of tab palette relative to the window
- kPopUpPal, # Palette type
- {3,6}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {20,20}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- } #### End Palette #1
- };
-
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global SelectTool := { 4, 1, "Select", kDrag, 0, {0} };
- global LassoTool := { 5, 1, "Lasso", kDrag, 0, {0} };
- global PencilTool := { 6, 1, "Pencil", kDrag, 0, {0} };
- global PaintBrushTool := { 7, 1, "Paint Brush", kDrag, 0, {0} };
- global EraserTool := { 8, 1, "Eraser", kDrag, 0, {0} };
- global LineTool := { 9, 1, "Line", kDrag, 0, {0} };
- global SprayPaintTool := { 10, 1, "Spray Paint", kDrag, 0, {0} };
- global RectangleTool := { 11, 1, "Rectangle", kDrag, 0, {0} };
- global RoundRectTool := { 12, 1, "Round Rect", kDrag, 0, {0} };
- global PaintBucketTool := { 13, 1, "Paint Bucket", kClick, 0, {0} };
- global CircleTool := { 14, 1, "Circle", kDrag, 0, {0} };
- global FreeHandTool := { 15, 1, "FreeHand", kDrag, 0, {0} };
- global TextTool := { 16, 1, "Text", kClick, 0, {0} };
- global HexagonTool := { 17, 1, "Hexagon", kDrag, 0, {0} };
- global PolygonTool := { 18, 1, "Polygon", kMultiClick, 1, {0} };
-
- global PaintToolList:={ SelectTool,
- LassoTool,
- PencilTool,
- PaintBrushTool,
- EraserTool,
- LineTool,
- SprayPaintTool,
- RectangleTool,
- RoundRectTool, # don't use PaintBucketTool because blacks out entire window
- CircleTool,
- FreeHandTool,
- TextTool,
- HexagonTool,
- PolygonTool
- };
-
- global gToolList:= PaintToolList;
- global gWindowInset := {1,20,1,1};
- global gBoundingRect:= global gFileName;
- global gDoWindowList := {0,0,1,1}; # Hypercard only supports zoom and drag
- end; #InitAppGlobals
-
- #########################################################################
- # CardTest()
- #========================================================================
- # Author: ML
- # Description: Tests the Card functions
- # Parameters: None
- # Returns: Nothing
- # Examples: CardTest();
- # Assumptions: None
- # Applications: Hypercard
- #========================================================================
- # History:
- #
- ########################################################################
- task CardTest()
- begin
- LogStr( "Beginning Card Edit Tests");
- CardTestList:= {'New','Delete','Copy','New','Paste'};
- NumCardTests:= card(CardTestList);
- for x:= 1 to NumCardTests
- begin
- CardName:=CardTestList[x];
- CardMenuitem:= "{CardName} Card";
- Selectmenuitem(CardMenuitem, 'Edit');
- end;
- end;
-
- #########################################################################
- # GoTest()
- #========================================================================
- # Author: ML
- # Description: Tests the Go functions
- # Parameters: None
- # Returns: Nothing
- # Examples: GoTest();
- # Assumptions: None
- # Applications: Hypercard
- #========================================================================
- # History:
- #
- ########################################################################
- task GoTest()
- begin
- LogStr( "Beginning Card navigation tests");
- GoTestList:= {'First','Next','Prev','Last','Back','Home','Back'};
- NumGoTests:= card(GoTestList);
- for x:= 1 to NumGoTests
- begin
- Selectmenuitem(GoTestList[x], 'Go');
- end;
- end;
-
- #########################################################################
- # PaintTest()
- #========================================================================
- # Author: ML
- # Description: Tests the Paint functions
- # Parameters: None
- # Returns: Nothing
- # Examples: PaintTest();
- # Assumptions: None
- # Applications: Hypercard
- #========================================================================
- # History:
- #
- ########################################################################
- task PaintTest()
- begin
- LogStr( "Beginning Paint tests");
- PaintTestList:= {'Select All','Invert','Darken','Lighten','Trace Edges',
- 'Rotate left','Rotate Right','Flip Vertical',
- 'Flip Horizontal','Opaque','Transparent'};
- NumPaintTests:= card(PaintTestList);
- for x:= 1 to NumPaintTests
- begin
- Selectmenuitem(PaintTestList[x], 'Paint');
- end;
- end;
-
- #########################################################################
- # views()
- #========================================================================
- # Author: ML
- # Description: Change views.
- # Parameters: None
- # Returns: Nothing
- # Examples: views();
- # Assumptions: None
- # Applications: Hypercard
- #========================================================================
- # History:
- #
- ########################################################################
- task views() begin
- LogStr( "Changing Views");
- Selectmenuitem('Select', 'Paint');
- selectmenuitem('Fatbits','Options');
- selectmenuitem('Fatbits','Options');
- end; # views()
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Hypercard (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel);
- InitDraw();
- InitFonts();
- global gAppTitle := 'Hypercard';
- global gAppVersion := '2.1'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; #This is used in SaveAs when saving files
- SuiteStart('Hypercard.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- InitAppGlobals(); # setup Hypercard's globals
- (*
- *)
- DoSetUpApp('Cancel',-1,0,,,,0); # select cancel if launched w/o home stack
-
- SelectMenuItem("Preferences", "Home");
- MoveRelativetoWindow(88,228,'Home',2);
- logstr('Selected the Painting User Level');
-
- SelectMenuItem("New Stack", "File"); # Create a New stack
- SaveAs(gFileName); # save/replace
-
- Scrapbook(global kScrapPict); # Paste PICT from Scrapbook
- Scrapbook(global kScrapText); # Paste TEXT from Scrapbook
-
- selectMenuItem("Save A Copy", "File"); # Select Save A Copy from the File menu
- wait(3);
- SelectButton('Cancel'); # Cancel the Standard SF_Put Dialog
- selectMenuItem("Save A Copy", "File"); # Select Save A Copy from the File menu
- wait(3);
- SaveAs(gFileName,0); # test SF_Put
-
- CardTest(); # Test Card functions
-
- GoTest(); # Test card navigation
-
- PageSetup(); # Page Setup Testing
-
- Scrapbook(global kScrapPICT); # Paste PICT from Scrapbook
-
- DoDraw(,gFileName); # test Paint tools
-
- PaintTest(); # test Paint functions
-
- Views(); # Change views
-
- DoCloseApp(-1, -1, 0); # Don't do Save As, about box, or page setup
-
- LogStr("############################# LIMITATIONS: ############################");
- logstr("NOTE: Do to unique nature of Hypercard, many standard QL tests can't be done.
- DoWindows not done because no title bars on compact Macs");
-
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script Hypercard
-